Source for file toolbar.containers.php

Documentation is available at toolbar.containers.php

  1. <?php
  2.  
  3. // ensure this file is being included by a parent file
  4. if (!defined'_VALID_MOS' AND !defined('_JEXEC')) die'Direct Access to this location is not allowed.' );
  5.  
  6. class mosToolbar {
  7.     var $act;
  8.     var $task;
  9.     // Create an instance, get the controlling parameters from the request
  10.     function mosToolbar ({
  11.         if ($this->act = mosGetParam ($_REQUEST'act''containers'));
  12.         else $this->act = 'containers';
  13.         if ($this->task = mosGetParam($_REQUEST'task''list'));
  14.         else $this->task = 'list';
  15.         $this->makeBar();
  16.     }
  17.     // create a toolbar based on the parameters found in $_REQUEST
  18.     function makeBar ({
  19.         $this->start();
  20.         $act $this->act;
  21.         $call_check array(&$this,$act);
  22.         if (is_callable($call_check)) $this->$act();
  23.         $this->finish();
  24.     }
  25.     // Any initial actions
  26.     function start ({
  27.         mosMenuBar::startTable();
  28.     }
  29.     // The following methods correspond exactly to the possible values
  30.     // of 'act' in the request.  They in turn correspond to all the
  31.     // possible options in the admin side drop down menu for Remository.
  32.     function containers ({
  33.         if ($this->task == 'add'$this->addMenu('Container');
  34.         elseif ($this->task == 'edit'$this->editMenu('Container');
  35.         else $this->listMenu('');
  36.     }
  37.     
  38.     // The cancel option is always formed the same way
  39.     function cancelButton ({
  40.         mosMenuBar::custom'list''cancel.png''cancel_f2.png''Cancel'false );
  41.     }
  42.     // The menu for adding something is always the same apart from the text
  43.     function addMenu ($entity{
  44.         mosMenuBar::save'save''Save '.$entity );
  45.         $this->cancelButton();
  46.     }
  47.     // The menu for editing something is always the same apart from the text
  48.     function editMenu ($entity{
  49.         mosMenuBar::save'save''Save '.$entity );
  50.         $this->cancelButton();
  51.     }
  52.     // The menu for a list of items is always the same apart from the text
  53.     function listMenu ($entity{
  54.         mosMenuBar::publishList'publish''Publish '.$entity );
  55.         mosMenuBar::unpublishList'unpublish''UnPublish '.$entity );
  56.         mosMenuBar::addNew'add''Add '.$entity );
  57.         mosMenuBar::editList'edit''Edit '.$entity );
  58.         mosMenuBar::deleteList'''delete''Delete '.$entity );
  59.     }
  60.     // Any concluding actions
  61.     function finish ({
  62.         mosMenuBar::spacer();
  63.         mosMenuBar::endTable();
  64.     }
  65.  
  66. }
  67.  
  68. $toolbar new mosToolbar();
  69.  
  70. ?>

Documentation generated on Mon, 05 May 2008 16:23:28 +0400 by phpDocumentor 1.4.0